package com.jbp.config;

import com.jbp.intercepter.RequestLogIntercepter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {


    /***
     * 拦截器注入
     * @return
     */

    @Autowired
    private RequestLogIntercepter requestLogIntercepter;


    /***
     * 拦截器注入
     * @return
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 拦截 /rest
        registry.addInterceptor(requestLogIntercepter)
                .addPathPatterns("/rest/**")
                .excludePathPatterns("/notemessage/send","/login",
                        "/appConfig/getParam","/isloginVerify","/rest/pay/notify","/rest/pay/wechatNotify/**");
    }


}
